package edu.uoc.tfc.gui.common;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;


public class SelectBox implements Serializable {
	
	private Option[] options;

	public Option[] getOptions() {
		return options;
	}

	public void setOptions(Option[] options) {
		
		List<Option> opcionsOrdenades = new ArrayList<Option>();
		Collections.addAll(opcionsOrdenades, options);
		Collections.sort(opcionsOrdenades);
		
		Option[] arrayOrdenat = new Option[opcionsOrdenades.size()];
		int i=0;
		for(Option o:opcionsOrdenades){
			arrayOrdenat[i]=o;
			i++;
		}
		this.options = arrayOrdenat;
		
	}

	
	
}
